package com.baizan.daka.ui.adapter


import android.widget.ImageView
import com.baizan.daka.mvp.model.bean.TaskInfoBean
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.BaseViewHolder
import com.dianzan.daka.R

class TaskMgrAdapter : BaseQuickAdapter<TaskInfoBean, BaseViewHolder>(R.layout.item_task_mgr) {


    override fun convert(helper: BaseViewHolder, item: TaskInfoBean) {
        helper.setText(R.id.user_phone_tv, "申请时间：${item?.createTime}")
            .setText(R.id.task_msg_tv, "要求：${item?.taskName}")
            .setText(R.id.price_tv, "¥${item.taskPrice}")
            .setText(R.id.task_No_tv, "编号：${item.id}")
            .setText(R.id.task_level_tv,item.taskStateName)
        when (item.taskClass) {
            1 ->
                helper.getView<ImageView>(R.id.task_icon_iv).setImageResource(R.mipmap.icon_douyin)
            2 ->
                helper.getView<ImageView>(R.id.task_icon_iv)
                    .setImageResource(R.mipmap.icon_kuanshou)
            0 ->
                helper.getView<ImageView>(R.id.task_icon_iv)
                    .setImageResource(R.mipmap.icon_pengyouquan)
        }

    }


}